package top.maof.book.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import top.maof.book.model.BookInfo;
import top.maof.book.result.Result;
import top.maof.book.service.BookInfoService;

@RestController
@RequestMapping("/bookInfo")
public class BookInfoController {

    @Autowired
    BookInfoService bookInfoService;

    @RequestMapping("/{bookId}")
    public Result get(@PathVariable("bookId") Integer bookId) {
        BookInfo one = bookInfoService.getByBookId(bookId);
        return Result.success(one);
    }
}
